package com.banmao.algorithm.No201To300.No236;

public class Answer {

    public static void main(String[] args) {

        Solution1 solution = new Solution1();

        //GenerateTreeNodeUtil<TreeNode> treeNodeUtil = new GenerateTreeNodeUtil<>(TreeNode.class);
        //TreeNode root = treeNodeUtil.generateTree(new Integer[]{3, 5, 1, 6, 2, 0, 8, null, null, 7, 4});

        TreeNode root = new TreeNode(3, new TreeNode(5, new TreeNode(6), new TreeNode(2, new TreeNode(7), new TreeNode(4))),
                new TreeNode(1, new TreeNode(0), new TreeNode(8)));


        TreeNode treeNode = solution.lowestCommonAncestor(root, new TreeNode(5), new TreeNode(1));

        System.out.println(treeNode.val);


    }

}
